<template>
	<view>
		我来了
		<view>
<!-- 			{{redirectUrl}}
			<button type="default" @click="redirectTo">跳转页面</button> -->
		</view>
	</view>
</template>

<script>
	export default{
		data(){
		return {
			redirectUrl:null,
			currentPge:'',//当前页面
		}
		},
		onLoad(options) {
			let pages = getCurrentPages()
			this.currentPge = pages[0].$route.fullPath
			this.redirectUrl =  uni.getStorageSync('redirectUrl')
			this.redirectTo()
			let token = options.token;
			// if(!token){
			// 	token = uni.getStorageSync('token')
			// }else{
			// 	uni.setStorageSync('token', token);
			// }
			// if(!this.$store.getters.getToken){
			// 	location.href = this.$store.state.URL + "/customer/user/wx_login?page=" +this.currentPge + '&activity_id='+this.options.activity_id + '&shared_customer_id=' + option.customer_id+"&store_id="+option.store_id
			// }
			
		},
		methods:{
			redirectTo(){
				uni.redirectTo({
					url:this.redirectUrl,
					success:function(res){
						console.log(res,'跳转成功！')
					},
					fail:function(err){
						console.log(err,'uni.redirectTo');
					}
				})
			},
			login(){
				//#ifdef H5
				location.href = this.$store.state.URL + "/customer/user/wx_login?page=" + this.currentPge
				//#endif
				
			},
		}
	}
</script>

<style>
</style>
